package cn.cefoc.openFeign;

import cn.cefoc.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServerFallbackFactory implements FallbackFactory<UserServer> {

    @Override
    public UserServer create(Throwable throwable) {
        return new UserServer() {
            public User getUserById(Long id) {
                return new User(1L,"发生熔断","网络异常");
            }
        };
    }
}
